/*******************************************************************************
 * Copyright (c) 2012 Clever Devices.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html
 * 
 * Contributors:
 * 	Clever Devices Interns - 
 * 	Alex Frankel, Andria Young, Kevin Thomas, Nicholas Culpepper, Taner Oztimurlenk, Thomas Volberg
 ******************************************************************************/
package com.framework.beans;

import com.framework.bustime_parser.ApiHandler;

public class Bus{
	public Bus(int latitude, int longitude, int identifier, String destination){
		lat = latitude;
		lon = longitude;
		id = identifier;
		dest = destination;
		
		ah = new ApiHandler();
		String xml = ah.getXML(ApiHandler.GET_PREDICTIONS + "vid=" + id);
		//prediction = ah.getNextStop(xml);	
	}
	
	public String toString(){
		return "ID: " + this.id + " LAT: " + this.lat + " LON: " + this.lon;
	}
	
	/**
	 * @return the id, latitude and longitude of a bus
	 * index 0 is the id, etc.
	 */
	public int [] getBus(){
		int [] location = {id,lat,lon};
		return location;
	}
	
	
	public String getDest(){return dest;}
	public int getId(){ return id;}
	
	int lat;
	int lon;
	int id;
	String dest; //destination of bus
	ApiHandler ah;
	Prediction prediction;
}
